﻿// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MS-PL license.
// See the LICENSE file in the project root for more information.

using System;
using Android.Support.V4.App;
using MvvmCross.ViewModels;

namespace MvvmCross.Droid.Support.V4
{
    public class MvxViewPagerFragmentInfo
    {
        public MvxViewPagerFragmentInfo(string title, string tag, Type fragmentType, Type viewModelType,
            object parameterValuesObject = null)
        {
            Title = title;
            Tag = tag;
            FragmentType = fragmentType;
            ViewModelType = viewModelType;
            ParameterValuesObject = parameterValuesObject;
        }

        public MvxViewPagerFragmentInfo(string title, string tag, Type fragmentType, 
            IMvxViewModel viewModel, object parameterValuesObject = null)
            : this(title, tag, fragmentType, viewModel.GetType(), parameterValuesObject)
        {
            ViewModel = viewModel;
        }

        public Type FragmentType { get; }

        public object ParameterValuesObject { get; }

        public string Tag { get; }

        public string Title { get; }

        public Type ViewModelType { get; }

        public IMvxViewModel ViewModel { get; }

        public Fragment CachedFragment { get; set; }
    }
}
